The attached code is for my Trigger Mediator. I have included a save file TRIGGERM.SAVF with all programs compiled at V5R2M0. If you need to compile to an earlier release, you might need to make some code changes. Most are not that much but this as as early as I could get to compile and I cannot save an earlier than V5R2M0 so I have included the source code separately. A note on compiling the objects. In module TG0001_M02, there is a constant named cUserSpaceLibrary. This is the library the program will attempt to put the user space if it doesn't exist. If you plan on moving somewhere else, you will need to edit this constant. The first note that I should make here is that I use a single source file called QSRCF so you need to create a library for the project and then create a single source file called QSRCF unless you want to change all the copy block references. The second note is that if you want to recompile, the TG_MED and TG0001 uses embedded SQL so requires the SQL compiler option. An earlier version of the TG001 and TG_MED using file I/O are available on this web site if you want to use file I/O. Finally, if you decide to put this into a production environment, if at all possible, put the TG_MED program into same library as the physical tables. If you have physical tables in mulitple libraries, then that is obviously not going to work. IBM suggests that the program be in the same library so that if the library is restored, the trigger program is restored first. Again the trigger mediator makes this a bit simplier. Instead of worrying about dozens of programs, you just have to make sure TG_MED gets restored before the physical tables. The trigger service programs can be restored at anytime before the tables are opened. The tables TGCTRLD and the user space TG_CTRL_HD need to be in a data library where they are accessible by the Mediator. Table TGCTRLH is for compiling only. If you want to recompile, I would recommend using NETSERVER and copying the source to a IFS directory and then using CPYFRMIMPF to copy to your source file although any method you want to use is fine. I have included my standard document on how to import files or save files to AS/400 from the PC. Once all the source is copied in QSRCF, create program AA_CREATE. AA_CREATE builds all the programs and service programs except the TS0001* series. The TS0001* program included is just a templete. You need to make a copy of it and insert your own trigger logic. I use one trigger service program per table with the same procedure name. You could, also, just create a single service program with different procedure names but that reduces your flexibility. If you want to modify the trigger service program, you would have to take everything off triggers. Note that there is no requirement that you have the same trigger service program for tables in different libraries. You can have one trigger service program for one table in one library and a different one for a different library if you need to or the same name trigger service program in two different versions (Like for testing). The way the Trigger Mediator works, as long as you tell it a specific library, it does care about the program name. It can load two different service programs with the same name. Call AA_CREATE with three parameters. Parameter one is 10 byte program library. Parameter two is 10 byte source library. Parameter three is 6 byte release to compile to. CALL PGM(BUILDMED) PARM('TRIGGERM ' 'TRIGGERM ' 'V5R2M0') Now you need to call program TG0001. This program maintains the trigger control tables and user space. See the separate trigger documentation for how to use. Here is a list of code that I have sent you. AA_CREATE - Builds all the various file, programs and service programs. CB_DBTRG_S - Trigger copy block. CB_DSPSFM - Display subfile messages copy block. CB_KEYP - Keys pressed copy block. CB_MAP_IND - Map indicators copy block. CB_STD_CON - Standard constants copy block. CB_STD_EM - Standard error data model copy block. CB_STDTYPE - Standard types copy block. XVERRH - Standard Error Handler. XVERRH_PR - Prototypes. XVERRH_BND - Bindary. XVERRH_M01 - Implementation of Throw. XVERRH_M02 - Store messages. XVERRH_M03 - Condition Handlers. XVMSGF - Standard Message Functions. XVMSGF_PR - Prototypes. XVMSGF_BND - Bindary. XVMSGF_M01 - Implementation. XVRLSV - Resolve object to system pointer. XVRSLV_PR - Prototypes. XVRSLV_BND - Bindary. XVRSLV_M01 - Implementation. XVDYNL - Dynamically load a service program. XVDYNL_PR - Prototypes. XVDYNL_BND - Bindary. XVDYNL_M01 - Implemenation. XVUSPC - User Space functions. XVUSPC_PR - Prototypes. XVUSPC_BND - Bindary. XVUSPC_M01 - Implemenation. TGCTRLH - Template file for the TG_CTRL_HD user space. For complie only. TGCTRLD - Trigger Detail Table. One record per table in triggers. TG_MED - Trigger mediator itself. TG_MED_M01 - "C" entrance procedure. TG_MED_M02 - RPGLE main module. TG_MED_M03 - SQLRPGLE module to read and load detail tables. TG_MED_PR - Trigger Mediator Prototypes. TG0001 is a five screen green screen to maintain a set of tables for my trigger mediator. I use ILE technique to build green screens. One module per screen. For a standard module type, 90% of the code is the same for that type. New screen of that type (For example, single page load), just clone and change the 10%. TG0001 - Top Level - Instructions on binding, setup and call screen one. TG0001_LP - Local Prototypes TG0001_D01 - Single display file. TG0001_M01 - Screen One - Standard Menu Panel TG0001_M02 - Screen Two - Standard Edit Panel TG0001_M03 - Screen Three - Standard Single Page Load Subfile Panel TG0001_M04 - Screen Four - Standard Add/Edit/Display Panel TG0001_M05 - Screen Five - Standard Delete Confirm Panel TS0001 - Trigger Service Program Templete. TS0001_BND - Bindary TS0001_M01 - Implementation. You will notice also that every source has instructions in the header for how to create the object except AA_CREATE. These instructions are meant to be used by my make tool COMPILE which you can find at www.think400.dk/downloads also but if you want to create a single object again, the instructions on how to create it are in the header. The user space TG_CTRL_HD is included in the save file but it will be created automatically the first time you invoke the TG001 and go into the first menu option. Please let me know if there are ways I can help make using these programs easier. I know there will be questions. I can reached at: Alan Campin (253) 266-7676 (Cell) alan0307d@bigfoot.com